import request from "@/utils/request";

// 用户登录
export const userLogin = async (data: TUserApi.TLoginParams) =>
  request<any>("/user/login", {
    method: "POST",
    data,
  });

// 获取用户信息
export const getUserInfo = async () =>
  request<any>("/user/getUserInfo");

// 系统用户列表
export const queryUserList = async (
  params: {
    username?: string;
    name?: string;
  } & TPageParam
) =>
  request<any>("/user/list", {
    method: "GET",
    params,
  });

export const slideLoginOut = async (data: TUserApi.TLoginParams) =>
  request<any>("/admin/auth/logout", {
    method: "POST",
    data,
  });

// 用户登录
export const slideLogin = async (data: TUserApi.TLoginParams) =>
  request<any>("/admin/auth/login", {
    method: "POST",
    data,
  });
// 用户注册
export const slideRegister = async (data: TUserApi.TLoginParams) =>
  request<any>("/admin/auth/register", {
    method: "POST",
    data,
  });
// 读
export const getStore = async (data: TUserApi.TLoginParams) =>
  request<any>("/store", {
    method: "GET",
    data,
  });
// 存
export const setStore = async (data: TUserApi.TLoginParams) =>
  request<any>("/store", {
    method: "PUT",
    data,
  });
